<template>
    <div class="recipe_list">
        <el-container>
            <el-header>
                <page-title>处方单审核</page-title>
            </el-header>
            <el-main class="content">
                <div class="search_box">
                    <el-row :gutter="20" style="min-width:1024px">
                        <el-col :span="6">
                            医生姓名：<el-input v-model="doctor" style="width:50%"></el-input>
                        </el-col>
                        <!-- <el-col :span="6">
                            收货人：<el-input v-model="consignee" style="width:50%"></el-input>
                        </el-col> -->
                        <el-col :span="6">
                            提交时间：
                            <el-date-picker
                                v-model="time"
                                type="daterange"
                                align="center"
                                unlink-panels
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期"
                                :default-value="new Date() - (30*24*60*60*1000)"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                :default-time="['00:00:00', '23:59:59']"
                                :picker-options="pickerOptions"
                                style="width: 64%">
                            </el-date-picker>
                        </el-col>
                        <el-col :span="6">
                            <el-button type="primary">查询结果</el-button>
                        </el-col>
                    </el-row>
                </div>

                <div class="table_box">
                    <el-table
                        :data="tableData"
                        border
                        style="width: 100%">
                        <el-table-column
                            prop="name"
                            label="患者姓名">
                        </el-table-column>

                        <el-table-column
                            prop="age"
                            label="患者年龄"
                            width="180">
                        </el-table-column>

                        <el-table-column
                            prop="diseaseInfo"
                            label="病情简介">
                        </el-table-column>

                        <el-table-column
                            prop="recipe"
                            label="处方">
                        </el-table-column>

                        <el-table-column
                            prop="advice"
                            label="医嘱">
                        </el-table-column>

                        <el-table-column
                            prop="time"
                            label="时间">
                        </el-table-column>

                        <el-table-column
                            prop="state"
                            label="处方单状态">
                        </el-table-column>

                        <el-table-column
                            label="操作"
                            width="100">
                            <template slot-scope="scope">
                                <el-button type="text" size="small">处方单详情</el-button>
                                <el-button type="text" size="small">打印</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>

                <!-- 详情弹框 -->
                <el-dialog
                    title="处方详情"
                    :visible.sync="detailsSwitch"
                    width="40%"
                    :before-close="handleClose">
                    <div>
                        <el-table
                            :data="tableData"
                            border
                            style="width: 100%">
                            <el-table-column
                                align="center"
                                prop="date"
                                label="药品编号">
                            </el-table-column>
                            <el-table-column
                                align="center"
                                prop="name"
                                label="药品名称">
                            </el-table-column>
                            <el-table-column
                                align="center"
                                prop="address"
                                label="药品数量">
                            </el-table-column>
                        </el-table>
                    </div>
                    <span slot="footer" class="dialog-footer">
                        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
                    </span>
                </el-dialog>
            </el-main>
        </el-container>
    </div>
</template>

<script>
export default {
    data() {
        return{
            //--------搜索相关---------
            doctor: '',//处方单编号
            time: '',//时间段
            //日期选择器配置
            pickerOptions: {
                disabledDate(date) {
                    return date && date.valueOf() > Date.now();
                }
            },

            //-----------表格相关------------
            tableData: [],//表格数据

            //-----------详情弹框相关--------
            detailsSwitch: false,//弹框开关
        }
    },

    //计算属性
    computed: {

    },

    //钩子函数（页面挂载完成时触发）
    mounted() {

    },

    //自定义方法
    methods: {

    },

    //注册组件
    components: {

    }
}
</script>

<style lang="scss">
    .recipe_list{
        .el-header{
            padding: 0;
        }
        .el-date-editor .el-range-separator{
            width: 20px;
        }
        .el-table__header tr th{
            background-color: #f6f6f6;
        }
        .content{
            padding: 20px 80px;
            overflow: hidden;
            .table_box{
                margin-top: 40px;
            }
        }
    }
</style>
